home *** CD-ROM | disk | FTP | other *** search
- HCC(1) User Commands HCC(1)
-
- NAME
-
- hcc - Hans' C compiler - the SOZOBON(X) compiler
-
- SYNOPSIS
-
- hcc [options] file [ file ... ]
-
- hcc [options] <inputfile> [<outputfile> [<errorfile>]]
-
- hcc [options] --inputfiles <inputfile> <inputfile> ...
-
- hcc [-VvhPNSLTQ] [-M<n>] [-I<path>] [-D<sym>[=<val>]] [-U<sym>]
- [-W{all|{+|-}{PTR|CMP|DIF|PMR|RDF|BRV|CUS|IFD|NPR}}] [-O<file>]
- [-E<file>][-X<n>[<func>]] <file> [<file> ...]
-
-
- DESCRIPTION
-
- The hcc command accepts C source files and generates assembly language
- output to the corresponding '.s' files. The pre-processor and all
- phases of the compiler are included within this program.
-
- There are different ways to specify the filenames with different
- results: After the '--inputfiles' option you can specify a list of
- inputfiles to compile. This may be usefull to get a list of all errors
- and no output, e.g.:
- hcc -O\dev\null -Eallmsgs --inputfiles file1.c file2.c ...
-
- The usual way to handle arguments now is the same as top and jas
- handle it:
- hcc <options> <inputfile> <outputfile> <errorfile>
-
- After the '<errorfile>' you can specify more <inputfile> <outputfile>
- pairs, with new <options> between the pairs. This goes not for top and
- jas. So the synopsis would be correctly:
-
- hcc [<options>] <infile> [<outfile> [<errfile>
- [[<options>] <infile> <outfile>]... ]]
- and:
-
- hcc [options] --inputfiles <inputfile> [[options] <inputfile>]...
-
- Of course there is a third way, mixing up these both schemes:
-
- hcc [options] <infile> [<outfile> [<errfile>]]
- --inputfiles <inpfile> [[options] <inpfile>]...
-
- This seems all a little bit complicated, but it isn't at all.
- The most of it are features, I didn't plan.
-
-
- You can specify '-' as <inputfile>, hcc will read from stdin than,
- and specify '-' as <outputfile> or <errorfile>, output goes to
- stdout. With no files specified hcc reads from stdin and writes
- to stdout.
-
-
- The following options are accepted by hcc:
-
- --version
- -V (Version)
- Print version information to stdout and exit.
-
- -v (verbose)
- Display a short version info and include filenames to stderr.
- And though an error file is written, print the messages to
- stderr, too.
-
- -h (help)
- Print a short info about commandline options.
-
- -N (nested)
- Allow nested comments.
-
- -M<n> (Messages)
- Stop compiling after <n> warning/error messages.
-
- -L (Long)
- Make 'int' a long type (32 Bits). Default an int is a short
- integer, and __MSHORT__ is defined.
- (this option is buggy, and not even tested)
-
- -S (Strings)
- Do not merge strings.
-
- -Q (Quick)
- Prefer generating of faster code to shorter code.
-
- -P (Profiling)
- Instructs the compiler to generate modified function
- entry code that will call a function
- 'void _prolog(char funcname[])'
- to count the number of calls to each function. And generate
- a function call of
- 'void _epilog(char funcname[])'
- To time the called function. You have to call function
- 'void _saveprof()'
- in the program on exit or use the prof_s.o startup code.
- (see Sozobon.Doc for more details)
-
- -T (Traps)
- Disable trap generation. By default hcc generates the trap
- instructions for OS calls whenever a OS call is identified.
-
- -I<path>
- Include <path> in the list of directories to be
- searched for header files (e.g. "-I\usr\include\myheader").
-
- -D<name>
- -D<name>=<value>
- Define the pre-processor macro <name>. If no value is
- given the macro is defined as 1.
-
- -U<name>
- Un-define one of the built-in macros.
-
- -X<n>[<function>] (Sorce Level Debugging Option)
- Instructs the compiler to generate some code for saving the
- line number for each source code line, and the module name
- for each function call. You will have to link a special
- module with his option, that tells you with which source
- code line and module an exception occured (cc will do this
- for you with this option).
- If you specify a function <function> for source level debugging,
- ('_debug' exists therefore in the library) you can tell hcc to
- call this function on every line of soucecode (level <n> = 2) or
- just at begin of every function and in some loops (level <n> = 1).
- (see Sozobon.Doc for more details)
-
- -O<file>
- Write output to file <file>.
-
- -E<file>
- Write error output (messages, warnings) to file <file>.
-
- -F[no-]double-reg-vars
- Put (do not) double vars declared register into regs.
- Default is on.
-
- -F[no-]float-args
- Pass (do not) float values as floats.
- Default is off, pass float args as doubles.
-
- -F[no-]frame-relative
- Generate A6 relative function exit code for all input files.
- Default is off.
- This flag is activated by hcc itself for the current
- function if a call to alloca() is detected, or by the
- '#pragma' statement "FRL" for current and following functions.
-
- -F[no-]proto
- Use function prototypes, check args and make implied casts.
- Default is on.
- This flag is also accessible via the '#pragma' statement "NPR"
-
- -F[no-]size-t-long
- Change return type of sizeof operator to "unsigned long".
- Default is "unsigned int".
-
- -Wall
- switch on all warning messages and inhibit switching them off
- with #pragma statements in source text.
-
- -W{+|-}<OPT>
- switch on or off printing of warning messages:
- PTR pointer types mismatch (default on)
- CMP cmp of diff ptrs (default on)
- DIF diff ptrs (default on)
- RDF redefined macro (default on)
- PUN undef of undefined macro (default on)
- PMR probably missinig return (default off)
- BRV bad return value/type (default on)
- CUS comparing unsigned and signed types (default on)
- IFD implicit declarate function (default off)
- NPR function call w/o prototype
-
- --inputfiles
- All arguments following are inputfiles, except the ones
- prefixed with a '-'. If not already defined, the <outputfile>
- and the <errorfile> are not taken from the argument list,
- except by the options '-O' and '-E'.
-
-
-
- Handling of include/header files / ipc
-
- (some text is missing here)
- If an '*.pre' file exists it is included, if it's timestamp is
- newer then the original filename. If the original file's timestamp
- is younger, a message is printed.
-
-
- The Builtin Prepocessor
-
- It doesn't know to handle the '#elif' statement. Compile
- with cc's '+P' option if it is in your source code.
-
- Macros
-
- Several macros are normally pre-defined. These are just
- int values, and you can '#undef' them:
- simply TRUE (1) are
- MC68000, mc68000, ATARI_ST,
- TOS, __TOS__,
- a significant int value (BCD) have:
- SOZOBON val: (0x200),
- __SOZOBONX__ val: (0x200 + X version level)
-
- __STDC__ set to val 0 if prototypes are checked, else undefined
- __MSHORT__ (TRUE if -L option was not given, ints are shorts)
-
- Some macros you can't touch with usual cpp statements:
- __BASE_FILE__, __FILE__, __LINE__,
- __TIME__, __DATE__, __VERSION__,
- __SDATE__, __STIME__, __GDATE__
- But you can use them in your source code.
-
- The following strings are unchange-able at all:
- __BASE_FILE__ (the name of the input file)
- __TIME__ (compile time string hh:mm:ss)
- __DATE__ (compile date string 'Mmm dd yyyy')
- __SDATE__ (compile date string, short format: YY/MM/DD)
- __STIME__ (compile time string, short format hh:mm)
- __GDATE__ (compile date string, german format: DD.MM.YY)
- __VERSION__ (compiler identification string: e.g.:
- "SOZOBONx hcc V2.00x16")
- The macros
- __FILE__ (string, current file - maybe a included one)
- __LINE__ (int, line number in current file)
- can be changed by using the cpp statement
- #line <lineno> ["<filename>"]
- An external cpp will generate those statements in it's output
- file to make the compiler print the real input filenames and
- line numbers in error messages.
-
-
- Known '#pragma' statements
-
- #pragma echo [anything]
- prints the rest of the line to stderr
-
- #pragma OPT "<string>" prints <string> in outputfile,
- format: ';opt <string>'
- For top/jas commands/options; You can pass a option
- string to top to switch top's optimizing switches.
- (see top.man)
-
- #pragma {+|-}<option>
- Switch the compiler option <option> on '+' or off '-'.
- print warnings?:
- PTR pointer types mismatch
- CMP cmp of diff ptrs
- DIF diff ptrs
- RDF redefined symbols
- PMR probably missinig return
- BRV bad return value/type
- CUS comparing unsigned and signed types
- IFD implicit declarate function
- NPR function call w/o prototype
- code generating options:
- STR concat strings?
- PRO Profiling (cmdln '-P'
- FST Quick-Flag (cmdln '-Q')
- TOP switch off/on Optimizer for this function
- FRL generate A6 relative function exit code
- this function (cmdln '-fframe-relative'
- for whole file)
- PTY use function prototypes
-
- ENVIRONMENT
-
- INCLUDEDIR path to reset default include dir path
- ("\usr\include", where dir 'xdlibs' is expected)
- A pathlist is generated from this variable, like:
- \usr\include\xdlibs,\usr\include
-
- INCLUDE list of pathes where include files can be found
-
- Directories listed in the "INCLUDE" environment variable
- replace the builtin ones. $INCLUDEDIR is ignored if $INCLDUE
- is set. cc always generates a $INCLDUE variable if $INCLUDEDIR is
- set. C-Desk will generate a $INCLDUE variable from the selected
- header file pathes, I think.
-
-
- STDERR
-
-
- COPYRIGHT
-
- hcc V2.00 Copyright (c) 1988-1992 by Sozobon, Ltd.
- for eXtended Version by C. Wempe & H. Weets,
- and J. Geiger 1992-1994
-
-
- BUGREPORTS
-
- Maintainer is now Volker Seebode. Please send bugreports using
- the 'bugform' to:
- seebode@plesnik.bonsai.de (Volker Seebode)
- or in MausNet:
- Volker Seebode @ AC3
-
- SEE ALSO
-
- cc(1), cpp(1), ipc(1)
-